<template>
<div id="con">
    <div>
        <div class="breadcrumb">
        <router-link to="/index">首页</router-link> &gt; &gt;
        <router-link to="/register" style="user-select: none;">注册</router-link>
        </div>
        <div class="reg">       
            <div><h1>注册会员</h1> </div>
            <div>              
                <input type="text" placeholder="请输入昵称" v-model="user_name">
                <input type="text" placeholder="请输入电话" v-model="user_phone">
                <input type="text" placeholder="请输入邮箱" v-model="user_email">
                <input type="password" placeholder="请输入密码" v-model="user_pwd">
                <!-- <input type="password" placeholder="确认密码"> -->
                <button @click="reg">注册</button>                   
            </div>
        </div>
    </div>
    
</div>
</template>

<script>
import { regAPI } from '@/api'
    export default {
        data() {
            return {
                user_phone: '',
                user_pwd:'',
                user_name:'',
                user_email:''
            }
        },
        methods: {
           async reg() {
                let params = {user_phone:this.user_phone,user_pwd:this.user_pwd,
                              user_name:this.user_name,user_email:this.user_email}
                const res = await regAPI(params)
                console.log('注册返回', res);
                // this.$message.success('注册成功！请重新登录')
                this.$router.push('/login')
            }
        },
    }
</script>
<style scoped src="../assets/css/register.css"></style>

<style lang="scss" scoped>

</style>